package lab7;

import java.util.Scanner;

public class EncryptDecrypt {

	public static String encrypt(String original)
	{
		if (original==null) return null;
		String encrypted=new String();
		for (int i = 0; i < original.length(); i+=2)
		{
			encrypted+=original.charAt(i);
		}
		for (int i = 1; i < original.length(); i+=2)
		{
			encrypted+=original.charAt(i);
		}
		return encrypted;
	}
	
	public static String decrypt(String encrypted)
	{
		if (encrypted==null) return null;
		String decrypted = new String();
		int pos1=0;
		int pos2=(encrypted.length()/2+encrypted.length()%2);
		for (int i = 0; i < encrypted.length(); i++)
		{
			if ((i&1)==0) 
			{
				decrypted+=encrypted.charAt(pos1);
				pos1++;
			}
			else
			{
				decrypted+=encrypted.charAt(pos2);
				pos2++;
			}
		}
		return decrypted;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String original = sc.nextLine();
		String encrypted = encrypt(original);
		System.out.println(encrypted);
		String decrypted = decrypt(encrypted);
		System.out.println(decrypted);
		original = null;
		encrypted = encrypt(original);
		System.out.println(encrypted);
		decrypted = decrypt(encrypted);
		System.out.println(decrypted);
	}

}
